<template>
    <div>
        <el-table :data="drawBomsList" :highlight-current-row="true" stripe border class="table-index"  style="width: 100%;" :height="tableHeight"
        :header-cell-style="getRowClass" v-loading="loading">
            <el-table-column fixed type="index" label="*"   min-width="40"></el-table-column>
            <el-table-column prop="name" label="机器名称"   min-width="100"></el-table-column>
            <el-table-column fixed="right" label="操作" align="center" width="120">
                <template slot-scope="scope">
                    <el-button @click="isShowDialog(scope.row)" type="text" size="mini">查看bom</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-dialog :title="dialog.title" width="90%"  top="10px" center :visible.sync="dialog.isShow" :close-on-click-modal="false" v-dialogDrag>
            <div>
             <el-row>
                 <el-col :span="9">
                    <el-popover placement="bottom-start" width="1000" style="box-shadow: 0 0 8px rgba(0,0,0,.5);" trigger="click" @show="showPopover" ref="searchBom">
                        <el-form :inline="true" :model="dialog.search">
                            <el-form-item label="bom名称" >
                                <el-input placeholder="请输入bom名称" v-model="dialog.search.bomName" class="inputSuffix"></el-input>
                            </el-form-item>
                            <el-form-item label="供应商名称">
                                <el-autocomplete  class="inputSuffix"  v-model="dialog.search.supplierName" :fetch-suggestions="searchAsyncSupplier" placeholder="请输入供应商名称" @select="changeSupplier"></el-autocomplete>
                            </el-form-item>
                             <el-form-item label="采购类型">
                                <el-select v-model="dialog.search.type" placeholder="请选择" class="inputSuffix">
                                    <el-option label="【空】" value=""></el-option>
                                    <el-option label="月采购" :value="1"></el-option>
                                    <el-option label="年采购" :value="2"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="单价">
                                <el-input placeholder="请输入内容" v-model="dialog.search.minPrice" class="inputSuffix">
                                    <template slot="prepend">最低单价</template>
                                </el-input>
                                <el-input placeholder="请输入内容" v-model="dialog.search.maxPrice" class="inputSuffix">
                                    <template slot="prepend">最高单价</template>
                                </el-input>
                            </el-form-item>
                            <el-form-item label="提前采购期">
                                <el-input placeholder="请输入内容" v-model="dialog.search.minpredate" class="inputSuffix">
                                    <template slot="prepend">最小提前采购期</template>
                                </el-input>
                                <el-input placeholder="请输入内容" v-model="dialog.search.maxpredate" class="inputSuffix">
                                    <template slot="prepend">最大提前采购期</template>
                                </el-input>
                            </el-form-item>
                            <el-form-item label="采购量">
                                <el-input placeholder="请输入内容" v-model="dialog.search.minminPurchase" class="inputSuffix">
                                    <template slot="prepend">最小采购量</template>
                                </el-input>
                                <el-input placeholder="请输入内容" v-model="dialog.search.maxminPurchase" class="inputSuffix">
                                    <template slot="prepend">最大采购量</template>
                                </el-input>
                            </el-form-item>
                            <el-form-item label="运输方式">
                                 <el-select v-model="dialog.search.transporttationMethod" placeholder="请选择" class="inputSuffix">
                                     <el-option label="【空】" value=""></el-option>
                                    <el-option :label="item.name" :value="item.code" v-for=" item in shippingMethodList" :key="item.id"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="支付方式">
                                <el-select v-model="dialog.search.paymentMethod" placeholder="请选择" class="inputSuffix">
                                    <el-option label="【空】" value=""></el-option>
                                    <el-option :label="item.name" :value="item.code" v-for=" item in payTypeList" :key="item.id"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-button type="primary" @click="searchData" icon="el-icon-search">查询</el-button>
                        </el-form>
                        <el-button slot="reference" type="primary">查询</el-button>
                    </el-popover>
                 </el-col>
                 <el-col :span="15">
                      <el-tag size="medium" type="success"><span class="maxTag">合计(合计x损耗系数): {{noTotals}} 元</span></el-tag>
                     <el-tag size="medium" type="success"><span class="maxTag">合计(单价x使用量): {{totals}} 元</span></el-tag>
                     <el-tag size="medium" type="success"><span class="maxTag">合计(单价x最小采购量): {{minPurchaseTotals}} 元</span></el-tag>
                 </el-col>
             </el-row>
            <el-table :data="dialog.bomList"   border class="table-index" style="width: 100%;margin-bottom: 10px;"
                :header-cell-style="getRowClass" v-loading="tableLoading" :row-class-name="tableRowClassName"  :max-height="tableHeight">
                <el-table-column sortable fixed type="index" label="*"  min-width="30" align="center"></el-table-column>
                <el-table-column sortable prop="cgMaterial.name" label="bom名称" show-overflow-tooltip  min-width="80" align="center"></el-table-column>
                <el-table-column sortable prop="drawCode" label="图纸标号"  min-width="40" align="center"></el-table-column>
                <el-table-column sortable prop="cgMaterial.type" label="物料型号"  min-width="80" align="center">
                    <!-- <template slot-scope="scope" >
                        <div v-if="scope.row.typeEdit"><el-input v-model="scope.row.cgMaterial.type" @blur="saveChangeCell(scope.$index,scope.row,'typeEdit')"></el-input></div>
                        <div  v-else v-text='scope.row.cgMaterial.type' @click='changeCell(scope.$index,scope.row,"typeEdit")' :style="{'height':scope.row.type?'':'20px'}"></div>
                    </template> -->
                </el-table-column>
                <el-table-column sortable prop="texture" label="材质"  width="80" align="center">
                    <!-- <template slot-scope="scope" >
                        <div v-if="scope.row.textureEdit"><el-input v-model="scope.row.cgMaterial.texture" @blur="saveChangeCell(scope.$index,scope.row,'textureEdit')"></el-input></div>
                        <div  v-else v-text='scope.row.cgMaterial.texture' @click='changeCell(scope.$index,scope.row,"textureEdit")'></div>
                    </template> -->
                </el-table-column>
                <el-table-column sortable prop="nums" label=" 使用量"  min-width="30" align="center">
                     <template slot-scope="scope" >
                        <div v-if="scope.row.numsEdit"><el-input v-model="scope.row.nums" @blur="saveChangeCell(scope.$index,scope.row,'numsEdit')"></el-input></div>
                        <div  v-else v-text='scope.row.nums' @click='changeCell(scope.$index,scope.row,"numsEdit")'></div>
                    </template>
                </el-table-column>
                <el-table-column sortable prop="cgMaterial.no" label="损耗系数"  width="80" align="center">
                    <!-- <template slot-scope="scope" >
                        <div v-if="scope.row.noEdit"><el-input v-model="scope.row.cgMaterial.no" @blur="saveChangeCell(scope.$index,scope.row,'noEdit')"></el-input></div>
                        <div  v-else v-text='scope.row.cgMaterial.no' @click='changeCell(scope.$index,scope.row,"noEdit")'></div>
                    </template> -->
                </el-table-column>
                <el-table-column sortable prop="cgMaterial.managerLevel" label="管理等级"  width="80" align="center">
                    <!-- <template slot-scope="scope" >
                        <div v-if="scope.row.managerLevelEdit">
                            <el-select v-model="scope.row.cgMaterial.managerLevel" placeholder="请选择" @change="saveChangeCell(scope.$index,scope.row,'managerLevelEdit')">
                                <el-option label="1" :value="1"></el-option>
                                <el-option label="2" :value="2"></el-option>
                                <el-option label="3" :value="3"></el-option>
                            </el-select>
                        </div>
                        <div v-else v-text='scope.row.cgMaterial.managerLevel' @click='changeCell(scope.$index,scope.row,"managerLevelEdit")'></div>
                    </template> -->
                </el-table-column>
                <el-table-column sortable prop="cgBomSupplier.price" label="单价"  min-width="40" align="center" ></el-table-column>
                <el-table-column sortable prop="total" label="合计"  min-width="40" align="center"></el-table-column>
                <el-table-column sortable  prop="cgBomSupplier.predate" label="提前采购期"  min-width="30" align="center" ></el-table-column>
                <el-table-column sortable prop="cgBomSupplier.minPurchase" label="最小采购量"  min-width="40" align="center"  ></el-table-column>
                <el-table-column sortable prop="minPurchaseTotal" label="最小采购量合计"  min-width="40" align="center" ></el-table-column>
                <el-table-column sortable  prop="cgSupplier.paymentMethod" label="付款方式"  min-width="40" align="center" :formatter="paymentMethodFormatter"  ></el-table-column>
                <el-table-column sortable  prop="cgSupplier.transporttationMethod" label="运输方式"  min-width="40" align="center" :formatter="transporttationMethodFormatter" ></el-table-column>
                <el-table-column sortable prop="cgBomSupplier.type" label="采购类型"  min-width="40" align="center">
                    <template slot-scope="scope">
                        <div v-if="scope.row.cgBomSupplier">
                            <span v-if="scope.row.cgBomSupplier.type===1">月采购</span>
                            <span v-if="scope.row.cgBomSupplier.type===2">年采购</span>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column sortable  prop="cgSupplier.name" label="供应商名称"  min-width="70" align="center"></el-table-column>
                <el-table-column fixed="right" label="操作" align="center" width="100">
                    <template slot-scope="scope">
                        <!-- <el-button @click="isShowDialog1(scope.row)" type="text" size="mini">关联供应商</el-button> -->
                         <el-button @click="isShowDialog3(scope.row)" type="text" size="mini">详情</el-button>
                    </template>
                </el-table-column>
            </el-table>
            </div>
            <div slot="footer" class="dialog-footer" style="text-align: left;color:rgb(96,98,102)">
               <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="dialog.pagination.currentPage" :page-sizes="[5,10, 15,20, 25,30,50, 100,300,500,1000]" :page-size="dialog.pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="dialog.pagination.total"></el-pagination>
            </div>
        </el-dialog>
        <el-dialog :title="dialog1.title" width="1100px"  center :visible.sync="dialog1.isShow" :close-on-click-modal="false" v-dialogDrag>
            <el-button type="success" @click="isShowDialog2('insert')" icon="el-icon-plus">新增</el-button>
            <el-table :data="dialog1.supplierList" :highlight-current-row="true" stripe border class="table-index"  style="width: 100%;" :max-height="tableHeight"
        :header-cell-style="getRowClass" >
                <el-table-column fixed type="index" label="*"  min-width="40" align="center"></el-table-column>
                <el-table-column prop="bomObj.name" label="bom名称" show-overflow-tooltip  min-width="80" align="center"></el-table-column>
                <el-table-column prop="supplierName" label="供应商名字" show-overflow-tooltip  min-width="120" align="center"></el-table-column>
                <el-table-column prop="minPurchase" label="最小采购量"   min-width="80" align="center"></el-table-column>
                <el-table-column prop="predate" label="采购提前期"  min-width="80" align="center"></el-table-column>
                <el-table-column prop="startNums" label=" 起初数" show-overflow-tooltip   min-width="80" align="center"></el-table-column>
                <el-table-column prop="price" label="单价"  min-width="100" align="center"></el-table-column>
                <el-table-column prop="type" label="采购类型"  min-width="100" align="center">
                    <template slot-scope="scope">
                       <div v-if="scope.row.type===1">月采购</div>
                        <div v-if="scope.row.type===2">年采购</div>
                    </template>
                </el-table-column>
                <el-table-column prop="creatorName" label="创建人"  min-width="100" align="center"></el-table-column>
                <el-table-column prop="createTime" label="创建时间"  min-width="100" align="center"></el-table-column>
                <el-table-column fixed="right" label="操作" align="center" width="100">
                    <template slot-scope="scope">
                        <el-button @click="isShowDialog2('update',scope.row)" type="text" size="mini">修改</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-dialog>
         <el-dialog :title="dialog2.title" width="750px" center :visible.sync="dialog2.isShow" :close-on-click-modal="false" v-dialogDrag>
            <div :style="tableDialogHeightTabPane">
            <el-form :inline="true" class="demo-form-inline" v-model="dialog2.fromData" label-position="right" label-width="120px">
                <el-form-item label="bom名称" ><el-input v-model="dialog1.bomObj.name" disabled></el-input></el-form-item>
                 <el-form-item label="物料型号" ><el-input v-model="dialog1.bomObj.type" disabled></el-input></el-form-item>
                <el-form-item label="供应商名称">
                    <el-autocomplete  class="autocomplete-row" v-model="dialog2.fromData.supplierName" :fetch-suggestions="querySearchAsync" placeholder="请输入供应商名称" @select="handleSelect"></el-autocomplete>
                </el-form-item>
                <el-form-item label="采购提前期">
                    <el-input v-model="dialog2.fromData.predate" class="inputSuffix">
                        <el-button slot="append">天</el-button>
                    </el-input>
                </el-form-item>
                <el-form-item label="最小采购量"><el-input v-model="dialog2.fromData.minPurchase" ></el-input></el-form-item>
                <el-form-item label="单价">
                    <el-input v-model="dialog2.fromData.price" class="inputSuffix"><el-button slot="append">元</el-button></el-input>
                </el-form-item>
                <el-form-item label="起初数"><el-input v-model="dialog2.fromData.startNums" ></el-input></el-form-item>
                <el-form-item label="采购类型">
                    <el-select v-model="dialog2.fromData.type" placeholder="采购类型">
                        <el-option
                        v-for="item in purchaseType"
                        :key="item.value"
                        :label="item.name"
                        :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="创建人" v-if="dialog2.title==='修改供应商列表'"><el-input v-model="dialog2.fromData.creatorName" disabled></el-input></el-form-item>
                <el-form-item label="创建时间" v-if="dialog2.title==='修改供应商列表'"><el-input v-model="dialog2.fromData.createTime" disabled></el-input></el-form-item>
            </el-form>
                </div>
            <div slot="footer" class="dialog-footer" style="text-align: center;">
                <el-button @click="submitList" type="primary">确 定</el-button>
            </div>
        </el-dialog>
        <!-- 查询物料管理图纸列表 -->
         <el-dialog :title="dialog3.title" width="1100px"  center :visible.sync="dialog3.isShow" :close-on-click-modal="false" v-dialogDrag>
            <el-table :data="dialog3.tableDate" :highlight-current-row="true" stripe border class="table-index"  style="width: 100%;" :max-height="tableHeight"
        :header-cell-style="getRowClass" >
                <el-table-column fixed type="index" label="*"  min-width="40" align="center"></el-table-column>
                <el-table-column prop="machineTypeName" label="机型" show-overflow-tooltip  min-width="80" align="center"></el-table-column>
                <el-table-column prop="drawIdName" label="图纸名" show-overflow-tooltip  min-width="120" align="center"></el-table-column>
            </el-table>
        </el-dialog>

    </div>
</template>
<script>
import cgbHttp from '@/axios/cgbHttp.js'
export default {
    data(){
        return {
            tableDialogHeightTabPane:{/**dialog style */
                'max-height': (document.documentElement.clientHeight - 300) + 'px',
                overflowY: 'auto'
            },
            tableHeight: document.documentElement.clientHeight - 240,/**表格高度 */
            drawBomsList:[],
            supplierAll:[],
            loading:false,
            tableLoading:false,
            dialog:{
                title:'',
                supplier:'',
                isShow:false,
                id:'',
                bomList:[],
                keyword:'',
                preSearch:{},
                search:{
                    bomName:'',
                    supplier:'',
                    supplierName:'',
                    minPrice:'',
                    maxPrice:'',
                    minpredate:'',
                    maxpredate:'',
                    minminPurchase:'',
                    maxminPurchase:'',
                    transporttationMethod:'',
                    paymentMethod:'',
                    type:''
                },
                total:'',
                pagination:{
                   currentPage:1,
                    pageSize:10,
                    total:0
                }
            },
            dialog1:{
                title:'',
                isShow:false,
                supplierList:[],
                bid:'',
                bomObj:{}
            },
            dialog2:{
                title:'',
                isShow:false,
                fromData:{}
            },
            dialog3:{
                title:'',
                isShow:false,
                tableDate:[]
            },
            purchaseType:[{
                value:1,
                name:'月采购'
            },{
                value:2,
                name:'年采购'
            }],
            allSupplierByBom:[],
            totals:'',
            minPurchaseTotals:'',
            noTotals:'',
            payTypeList:[],/**所有付款方式 */
            shippingMethodList:[]/**所有运输方式 */
        }
    },
    created(){
        let self = this;
        self.getDrawBomsList();
        self.getSupplierAllList();
        cgbHttp.supplierCode(6).then(res=>{
             /**获取付款方式 */
             res.content.forEach(element => {
                element.code = Number( element.code)
            });
            self.payTypeList = res.content;
        })
        cgbHttp.supplierCode(7).then(res=>{
             /**获取运输方式 */
              res.content.forEach(element => {
                element.code = Number( element.code)
            });
            self.shippingMethodList = res.content;
        })

    },
    methods:{
        supplierAllList(data){ //所有供应商列表
            let self = this;
            cgbHttp.supplierBybom(data).then(res =>{
                if(res.content&&res.content.length>0){
                    res.content.forEach(item=>{
                        item.value = item.name
                    })
                    self.allSupplierByBom=res.content
                }
            })

        },
        tableRowClassName(scope){
           if(scope.row.isHas==='1'){
               return 'successRow'
           }
        },
        getDrawBomsList(){
            let self = this;
            self.loading = true;
            cgbHttp.getDrawBomsList().then(res=>{
                let result=[];
                 res.content.forEach(item=>{
                     if(item.id===10){
                         result.push(item);
                     }
                 })
                self.drawBomsList =result;
                self.loading = false;
            },error=>{
              self.loading = false;
            })
        },
        isShowDialog(row){
            let self = this;
            self.dialog.title =  row.type+'Bom列表'
            self.dialog.isShow = true;
            self.dialog.id= row.id;
            self.dialog.search={
                bomName:'',
                supplier:'',
                supplierName:'',
                minPrice:'',
                maxPrice:'',
                minpredate:'',
                maxpredate:'',
                minminPurchase:'',
                maxminPurchase:'',
                transporttationMethod:'',
                paymentMethod:'',
                type:''
            };
            self.getBomList();
        },
        searchBom(){
            let self = this;
            self.getBomList();
        },
        getBomList(){
            let self = this;

            let data={
                currentPage:self.dialog.pagination.currentPage,
                pageSize:self.dialog.pagination.pageSize,
                machineType:self.dialog.id,
                bomName:self.dialog.search.bomName,
                supplier:self.dialog.search.supplierName===''?'': self.dialog.search.supplier,
                minPrice:self.dialog.search.minPrice,
                maxPrice:self.dialog.search.maxPrice,
                minpredate:self.dialog.search.minpredate,
                maxpredate:self.dialog.search.maxpredate,
                minminPurchase:self.dialog.search.minminPurchase,
                maxminPurchase:self.dialog.search.maxminPurchase,
                transporttationMethod:self.dialog.search.transporttationMethod,
                paymentMethod:self.dialog.search.paymentMethod,
                type:self.dialog.search.type
            }
            self.tableLoading = true;
            self.dialog.preSearch = data;
            cgbHttp.supplierAndBomList(data).then(res=>{
                self.tableLoading = false;
                self.dialog.bomList=res.content.cgBoms;
                self.totals = res.content.totals;
                self.dialog.total=res.content.total
                self.minPurchaseTotals = res.content.minPurchaseTotals
                self.noTotals = res.content.noTotals;
                self.dialog.pagination.total=res.content.total;
            },error=>{
                self.tableLoading = false;
            })
        },
        getSupplierAllList(){
            let self = this;
            cgbHttp.supplierAllList().then(res=>{
                 res.content.forEach(element => {
                   element.value = element.name;
                });
                self.supplierAll= res.content;
            })
        },
        handleSizeChange(size){
            this.dialog.pagination.pageSize = size;
            this.getBomList();
        },
        handleCurrentChange(current){
            this.dialog.pagination.currentPage = current;
            this.getBomList();
        },
        isShowDialog1(row){
            let self = this;
            self.dialog1.title = '关联供应商列表'
            self.dialog1.isShow = true;
            self.dialog1.bid = row.id;
            self.dialog1.bomObj = row;
            self.getSupplierList()
        },
        getSupplierList(){
            let self = this;
            cgbHttp.getSupplierList(self.dialog1.bid).then(res=>{
                res.content.forEach(item=>{
                    item.bomObj =  self.dialog1.bomObj;
                })
                self.dialog1.supplierList = res.content;
            })
        },
        isShowDialog2(type,row){
            let self = this;
            self.dialog2.title = type==='insert'?'新增供应商列表':'修改供应商列表';
            self.dialog2.isShow = true;
            self.dialog2.fromData = type==='insert'?{
                type:1
            }:row;
        },
        querySearchAsync(queryString, callback){
            let results = queryString ?  this.supplierAll.filter(this.createStateFilter(queryString)) : this.supplierAll;
            callback(results);
        },
        handleSelect(item){
            this.dialog2.fromData.sid = item.id;
            this.dialog2.fromData.supplierName = item.value;
        },
        createStateFilter(queryString) {
            return (state) => {
                return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) !==-1);
            };
        },
        submitList(){
            let self = this;
            let type = self.dialog2.title.indexOf('新增')>-1?'insert':'update';
            let data={
                id:self.dialog2.fromData.id,
                bid:self.dialog1.bid,
                bomName:self.dialog2.fromData.bomName,
                sid:self.dialog2.fromData.sid,
                supplierName: self.dialog2.fromData.supplierName,
                minPurchase:self.dialog2.fromData.minPurchase,
                predate:self.dialog2.fromData.predate,
                startNums:self.dialog2.fromData.startNums,
                price:self.dialog2.fromData.price,
                type:self.dialog2.fromData.type
            }
            cgbHttp.addUpdateAboutSupplier(type,data).then(res=>{
               self.dialog2.isShow = false;
               self.getSupplierList();
               self.getBomList();
               self.$message.success(`${self.dialog2.title}`)
            })
        },
        searchAsyncSupplier(queryString, callback){
            let results = queryString ?  this.supplierAll.filter(this.createStateFilter(queryString)) : this.supplierAll;
            callback(results);
        },
        changeSupplier(item){
            this.dialog.search.supplier = item.id;
            this.dialog.search.supplierName = item.value;
        },
        searchData(){
            this.getBomList();
            this.$refs.searchBom.doClose();
        },
        showPopover(){
            let postData={
                bomName:this.dialog.preSearch.bomName,
                machineType:this.dialog.preSearch.machineType,
                maxPrice:this.dialog.preSearch.maxPrice,
                maxminPurchase:this.dialog.preSearch.maxminPurchase,
                maxpredate:this.dialog.preSearch.maxpredate,
                minPrice:this.dialog.preSearch.minPrice,
                minminPurchase:this.dialog.preSearch.minminPurchase,
                minpredate:this.dialog.preSearch.minpredate,
                paymentMethod:this.dialog.preSearch.paymentMethod,
                supplier:'',
                transporttationMethod:this.dialog.preSearch.transporttationMethod,
                type:this.dialog.preSearch.type
            }
            // this.supplierAllList(postData);
        },
        paymentMethodFormatter(row, column, cellValue, index){
            let self = this;
            let name = '';
            self.payTypeList.forEach(item=>{
                if(Number(item.code) === cellValue){
                   name =item.name;
                }
            })
            return name;
        },
        transporttationMethodFormatter(row, column, cellValue, index){
            let self = this;
             let name = '';
            self.shippingMethodList.forEach(item=>{
                if(Number(item.code) === cellValue){
                   name = item.name;
                }
            })
            return name;
        },
        cgbomFormatter(row, column, cellValue, index){
            return cellValue?cellValue:''
        },
        changeCell(index,row,type){
           let self = this;
           self.dialog.bomList[index][type] = true;
           self.$set(self.dialog.bomList,index,row)
        },
        saveChangeCell(index,row,type){
           let self = this;
          self.dialog.bomList[index][type] = false;
           self.$set(self.dialog.bomList,index,row);
          cgbHttp.supplierAndBonChangeBom(row).then(res=>{
              self.$message.success("修改成功");
              self.getBomList();
          },error=>{
              self.getBomList();
               self.$message.error("修改失败");
          })
        },
        isShowDialog3(row){
            let self = this;
            self.dialog3.title=`${row.cgMaterial.name}详情`;
            self.dialog3.isShow = true;
            cgbHttp.selectByMid(row.mid).then(res=>{
                self.dialog3.tableDate= res.content;
            })
        }
    }
}
</script>
<style scoped>
.maxTag{
    font-size: 14px;
    font-weight: bold;
}
</style>


